package com.shiyingzi.security.service.impl;

import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.shiyingzi.common.PageUtils;
import com.shiyingzi.common.PageableData;
import com.shiyingzi.common.ResponseData;
import com.shiyingzi.security.dao.MenuDao;
import com.shiyingzi.security.model.Menu;
import com.shiyingzi.security.service.IMenuService;

@Service(IMenuService.BEAN_ID)
public class MenuServiceImpl extends ServiceImpl<MenuDao, Menu> implements IMenuService {


	@Autowired
	private MenuDao menuDao;	
	@Override
	public ResponseData insertMenu(Menu menu) {
		
		return null;
	}

	@Override
	public ResponseData updateMenu(Menu user) {
		
		return null;
	}

	@Override
	public ResponseData deleteMenu(String id) {
		
		return null;
	}

	@Override
	public ResponseData getMenuById(String id) {
		
		return null;
	}

	@Override
	public PageableData<Menu> queryUserList(int page, int limit, String menuName) {

		Page<Menu> mypage = new Page<Menu>();
		mypage.setCurrent(page);
		mypage.setSize(limit);
		Menu ac =new Menu();
		if(!StringUtils.isEmpty(menuName)){
//			ac.setDicValue(dicName);
			ac.setMenuName(menuName);
		}
		return PageUtils.tableDataDto(selectPage(mypage,new EntityWrapper<Menu>(ac).orderBy("createTime")));
	}

}
